package cn.tjnext.apply.service;

import cn.tjnext.apply.dao.PayCallBackDao;
import cn.tjnext.apply.entity.PayCallBackEntity;
import cn.tjnext.apply.repositories.PayCallBackRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by cp on 2017/8/14.
 */
@Service
@Transactional(readOnly = true)
public class PayCallBackService extends AbstractService<PayCallBackEntity, PayCallBackRepository, PayCallBackDao> {

    @Autowired
    private PayCallBackDao payCallBackDao;

    @Override
    protected PayCallBackDao getDao() {
        return payCallBackDao;
    }

    /**
     * 按订单号查询支付信息
     * @param orderId
     * @return
     */
    public PayCallBackEntity findByOrderId(Long orderId) {
        return payCallBackDao.findByOrderId(orderId);
    }
}
